﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using Frogism.Core;

namespace Frogism.Data {
  public class ObjectNameBaseLoader :LoaderBase<ObjectNameBase,IObjectNameBase> {
    protected override IObjectNameBase GetEmptyObject() {
      return new ObjectNameBase();
    }

    protected override void FillObject(IObjectNameBase i, FriendlyReader reader) {
      i.Name = reader.String("Name");
    }
    public IObjectNameBase GetById(string TableName, int id) {
      string sql = "select * from " + TableName + " where id=@id";
      return this.SqlGetById(sql, id);
    }
    public Collection<IObjectNameBase> GetAll(string TableName) {
      string sql = "select * from " + TableName + " order by Name Desc";
      return this.SqlGetAll(sql);
    }
    protected override string ProcNameGetAll {
      get { throw new NotImplementedException(); }
    }

    protected override string ProcNameGetById {
      get { throw new NotImplementedException(); }
    }


  }
}
